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, "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/hAsBh
function name:  (null)
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     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/hAsBh
function name:  __construct
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     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  $1      
          4        ASSIGN_OBJ                                               'newfunc'
          5        OP_DATA                                                  $1
    8     6        FETCH_THIS                                       ~2      
          7        INIT_ARRAY                                       ~3      ~2
          8        ADD_ARRAY_ELEMENT                                ~3      'newfunc'
          9        INIT_USER_CALL                                2          'call_user_func', ~3
         10        SEND_USER                                                1
         11        SEND_USER                                                2
         12        DO_FCALL                                      0          
   10    13      > RETURN                                                   null

End of function __construct

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.01 ms | 1393 KiB | 16 Q