3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = function(){}; $y = function($x){echo 'foo';}; $z = function($x){echo 'bar';}; var_dump(array_search(function($x){echo 'foo';}, array($x,$y,$z)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pQHYY
function name:  (null)
number of ops:  18
compiled vars:  !0 = $x, !1 = $y, !2 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpQHYY%3A3%240'
          1        ASSIGN                                                   !0, ~3
    4     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpQHYY%3A4%241'
          3        ASSIGN                                                   !1, ~5
    5     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpQHYY%3A5%242'
          5        ASSIGN                                                   !2, ~7
    7     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'array_search'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpQHYY%3A7%243'
          9        SEND_VAL                                                 ~9
         10        INIT_ARRAY                                       ~10     !0
         11        ADD_ARRAY_ELEMENT                                ~10     !1
         12        ADD_ARRAY_ELEMENT                                ~10     !2
         13        SEND_VAL                                                 ~10
         14        DO_ICALL                                         $11     
         15        SEND_VAR                                                 $11
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FpQHYY%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pQHYY
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpQHYY%3A3%240

Function %00%7Bclosure%7D%2Fin%2FpQHYY%3A4%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pQHYY
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        ECHO                                                     'foo'
          2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpQHYY%3A4%241

Function %00%7Bclosure%7D%2Fin%2FpQHYY%3A5%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pQHYY
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        ECHO                                                     'bar'
          2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpQHYY%3A5%242

Function %00%7Bclosure%7D%2Fin%2FpQHYY%3A7%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pQHYY
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        ECHO                                                     'foo'
          2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpQHYY%3A7%243

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.79 ms | 1400 KiB | 17 Q