3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HelloWorld { public function toString() { return serialize($this); } } $reflectionMethod = new ReflectionMethod('HelloWorld', '__toString'); echo $reflectionMethod->invokeArgs(new HelloWorld(), array()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V043S
function name:  (null)
number of ops:  13
compiled vars:  !0 = $reflectionMethod
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'ReflectionMethod'
          1        SEND_VAL_EX                                              'HelloWorld'
          2        SEND_VAL_EX                                              '__toString'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   10     5        INIT_METHOD_CALL                                         !0, 'invokeArgs'
          6        NEW                                              $4      'HelloWorld'
          7        DO_FCALL                                      0          
          8        SEND_VAR_NO_REF_EX                                       $4
          9        SEND_VAL_EX                                              <array>
         10        DO_FCALL                                      0  $6      
         11        ECHO                                                     $6
   11    12      > RETURN                                                   1

Class HelloWorld:
Function tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V043S
function name:  toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    5     5*     > RETURN                                                   null

End of function tostring

End of class HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.15 ms | 1386 KiB | 15 Q