3v4l.org

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

Class Hoge:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) 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      'Hoge'
          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
1 jumps found. (Code = 62) 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
1 jumps found. (Code = 62) 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      'Hoge'
          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 8.0.0


preferences:
150.22 ms | 1401 KiB | 15 Q