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
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/FHFNQ
function name:  (null)
number of ops:  19
compiled vars:  !0 = $d
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP                                                      
  18     1        NOP                                                      
         2        NOP                                                      
  25     3        INIT_FCALL                                               'var_export'
         4        NEW                                              $4      :-3
         5        DO_FCALL                                      0          
         6        SEND_VAR                                                 $4
         7        SEND_VAL                                                 <true>
         8        DO_ICALL                                         $6      
         9        CONCAT                                           ~7      '%24d%3D', $6
        10        CONCAT                                           ~8      ~7, '%3B'
        11        INCLUDE_OR_EVAL                                          ~8, EVAL
  28    12        FETCH_DIM_R                                      $10     !0, 'a'
        13        CONCAT                                           ~11     $10, '%0A'
        14        ECHO                                                     ~11
  31    15        FETCH_DIM_R                                      $12     !0, 'b'
        16        CONCAT                                           ~13     $12, '%0A'
        17        ECHO                                                     ~13
        18      > RETURN                                                   1

Class Hoge:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/FHFNQ
function name:  __construct
number of ops:  5
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  13     0  E >   NEW                                              $1      :-5
         1        DO_FCALL                                      0          
         2        ASSIGN_OBJ                                               'c'
         3        OP_DATA                                                  $1
  14     4      > RETURN                                                   null

End of function __construct

End of class Hoge.

Class TestHoge:
Function __set_state:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/FHFNQ
function name:  __set_state
number of ops:  3
compiled vars:  !0 = $data
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  20     0  E >   RECV                                             !0      
  22     1      > RETURN                                                   !0
  23     2*     > RETURN                                                   null

End of function __set_state

Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/FHFNQ
function name:  __construct
number of ops:  5
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  13     0  E >   NEW                                              $1      :-5
         1        DO_FCALL                                      0          
         2        ASSIGN_OBJ                                               'c'
         3        OP_DATA                                                  $1
  14     4      > RETURN                                                   null

End of function __construct

End of class TestHoge.

Generated using Vulcan Logic Dumper, using php 7.1.0