3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $a = array(); function getA() { return $this->a; } } $byReflection = (new ReflectionClass('Test'))->newInstanceWithoutConstructor(); $bySerialization = unserialize('O:4:"Test":0:{}'); $bySerializationWithProperty = unserialize(sprintf('O:4:"Test":1:{%s%s', serialize("\0*\0a"), serialize(array()))); var_dump($byReflection); var_dump($bySerialization); var_dump($bySerializationWithProperty);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rRh5G
function name:  (null)
number of ops:  35
compiled vars:  !0 = $byReflection, !1 = $bySerialization, !2 = $bySerializationWithProperty
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $3, 'newInstanceWithoutConstructor'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !0, $5
   12     6        INIT_FCALL                                               'unserialize'
          7        SEND_VAL                                                 'O%3A4%3A%22Test%22%3A0%3A%7B%7D'
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !1, $7
   13    10        INIT_FCALL                                               'unserialize'
         11        INIT_FCALL                                               'sprintf'
         12        SEND_VAL                                                 'O%3A4%3A%22Test%22%3A1%3A%7B%25s%25s'
         13        INIT_FCALL                                               'serialize'
         14        SEND_VAL                                                 '%00%2A%00a'
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        INIT_FCALL                                               'serialize'
         18        SEND_VAL                                                 <array>
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                         $11     
         22        SEND_VAR                                                 $11
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !2, $12
   15    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
   16    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
   17    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Class Test:
Function geta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rRh5G
function name:  getA
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function geta

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.21 ms | 1396 KiB | 21 Q