3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $newfunc; public function __construct() { $this->newfunc = create_function('$a,$b','print "ln($a) + ln($b) = ".log($a * $b);'); call_user_func(array($this, $this->newfunc), 1, 2); $this->$newfunc(1, 2); } } $f = new foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aIMfu
function name:  (null)
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aIMfu
function name:  __construct
number of ops:  19
compiled vars:  !0 = $newfunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL_BY_NAME                                       'create_function'
          1        SEND_VAL_EX                                              '%24a%2C%24b'
          2        SEND_VAL_EX                                              'print+%22ln%28%24a%29+%2B+ln%28%24b%29+%3D+%22.log%28%24a+%2A+%24b%29%3B'
          3        DO_FCALL                                      0  $2      
          4        ASSIGN_OBJ                                               'newfunc'
          5        OP_DATA                                                  $2
    9     6        FETCH_THIS                                       ~3      
          7        INIT_ARRAY                                       ~4      ~3
          8        FETCH_OBJ_R                                      ~5      'newfunc'
          9        ADD_ARRAY_ELEMENT                                ~4      ~5
         10        INIT_USER_CALL                                2          'call_user_func', ~4
         11        SEND_USER                                                1
         12        SEND_USER                                                2
         13        DO_FCALL                                      0          
   10    14        INIT_METHOD_CALL                                         !0
         15        SEND_VAL_EX                                              1
         16        SEND_VAL_EX                                              2
         17        DO_FCALL                                      0          
   11    18      > RETURN                                                   null

End of function __construct

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.79 ms | 1394 KiB | 16 Q