3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public $x; public function foo() { ($this->x)(42); } } $a = new A; $a->x = function($v) {var_dump($v);}; $a->foo();
based on HYiYm
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gru6m
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   9     1        NEW                                              $2      :-5
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $2
  10     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGru6m0x7f5289f42085'
         5        ASSIGN_OBJ                                               !0, 'x'
         6        OP_DATA                                                  ~6
  11     7        INIT_METHOD_CALL                                         !0, 'foo'
         8        DO_FCALL                                      0          
         9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGru6m0x7f5289f42085:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gru6m
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $v
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   RECV                                             !0      
         1        INIT_FCALL                                               'var_dump'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                                 
         4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGru6m0x7f5289f42085

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gru6m
function name:  foo
number of ops:  5
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   FETCH_OBJ_R                                      $0      'x'
         1        INIT_DYNAMIC_CALL                                        $0
         2        SEND_VAL_EX                                              42
         3        DO_FCALL                                      0          
         4      > RETURN                                                   null

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 7.3.0