3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** 取り出したい対象のオブジェクト */ class Hoge { protected $a = 'maa'; private $b = 2; } /** 取り出すためのコード */ class TestHoge extends Hoge { public static function __set_state($data) { return $data; } } eval('$c='.var_export(new TestHoge, true).';'); // protectedメンバ$aを取得 echo $c['a'] . PHP_EOL; // privateメンバ$bを取得 echo $c['b'] . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MOr5B
function name:  (null)
number of ops:  16
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     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      '%24c%3D', $3
          7        CONCAT                                           ~5      ~4, '%3B'
          8        INCLUDE_OR_EVAL                                          ~5, EVAL
   21     9        FETCH_DIM_R                                      ~7      !0, 'a'
         10        CONCAT                                           ~8      ~7, '%0A'
         11        ECHO                                                     ~8
   24    12        FETCH_DIM_R                                      ~9      !0, 'b'
         13        CONCAT                                           ~10     ~9, '%0A'
         14        ECHO                                                     ~10
         15      > RETURN                                                   1

Class Hoge: [no user functions]
Class TestHoge:
Function __set_state:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MOr5B
function name:  __set_state
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1      > RETURN                                                   !0
   16     2*     > RETURN                                                   null

End of function __set_state

End of class TestHoge.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.63 ms | 1395 KiB | 15 Q