3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** 取り出したい対象のオブジェクト */ class Hoge { protected $a = 'maa'; private $b = 2; public $c; function __construct() { $this->c = new Hoge; } } /** 取り出すためのコード */ class TestHoge extends Hoge { public static function __set_state($data) { return $data; } } eval('$d='.var_export(new TestHoge, true).';'); // protectedメンバ$aを取得 echo $d['a'] . PHP_EOL; // privateメンバ$bを取得 echo $d['b'] . PHP_EOL;
based on MOr5B
Output for 7.1.0 - 7.1.7, 7.2.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /in/FHFNQ on line 13
Process exited with code 255.
Output for 7.0.20, 7.1.10

Process exited with code 137.
Output for 7.0.0 - 7.0.6
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4194304 bytes) in /in/FHFNQ on line 13
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 16777216 bytes) in /in/FHFNQ on line 13
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 523800 bytes) in /in/FHFNQ on line 13
Process exited with code 255.