Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

OOP PHP

Name: Anonymous 2010-10-16 22:34

So i downloaded the latest Php version to try out this oop it has and i have some problems.


<?php
class foo{
    public $v1;
    public $v2;
}

$bar = new foo();
$bar->v1=1;
$bar->v2=5;
echo $bar->v1;
?>



now my problem is that the first '>'@($bar->v1=1;) makes the php script turn off and go back to html i guess... was there something else i needed to do before i could just jump right into oop php?

Name: Anonymous 2010-10-17 6:12

>>5
It's quite simple. The code he has is valid PHP, and it will produce the expected result if run directly. (Try saving it to temp.php and running 'php temp.php') The problem is that he will be running it from a webserver where the webserver is not set to interpret the code, but to simply print it.

Yes, I made a helpful post.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List