<?php
class A
{
public $a = 0;
public function printCount()
{
print $this -> a;
print PHP_EOL; // print a new line.
}
}
class B
{
public $b = 0;
public function doSomethingWith( $a )
{
$a -> a++;
}
}
$a = new A();
$b = new B();
$a -> printCount();
$b -> doSomethingWith( $a );
$a -> printCount();
0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/23m5t on line 11
PHP_EOL1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/23m5t on line 11
PHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/23m5t on line 6
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/23m5t on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/23m5t on line 6
Process exited with code 255.