3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $var1 = 'value 1'; public $var2 = 'value 2'; public $var3 = 'value 3'; protected $protected = 'protected var'; private $private = 'private var'; function iterateVisible() { echo "MyClass::iterateVisible:\n"; foreach($this as $key => $value) { print "$key => $value\n"; } } } $class = new MyClass(); array_map(function($v) { var_dump($v); }, $class)
Output for 5.4.16
Parse error: syntax error, unexpected end of file in /in/Pt3rd on line 27
Process exited with code 255.
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected end of file in 7WAF9 on line 27
Process exited with code 255.
Output for 5.3.25 - 5.3.26
Parse error: syntax error, unexpected $end in /in/Pt3rd on line 27
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected $end in 7WAF9 on line 27
Process exited with code 255.

preferences:
175.96 ms | 1399 KiB | 51 Q