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($x, array($x,$y,$z), false)); var_dump(array_search($y, array($x,$y,$z), false)); var_dump(array_search($z, array($x,$y,$z), false)); var_dump(array_search(function(){}, array($x,$y,$z), false));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n8Eko
function name:  (null)
number of ops:  52
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%2Fn8Eko%3A3%240'
          1        ASSIGN                                                   !0, ~3
    4     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fn8Eko%3A4%241'
          3        ASSIGN                                                   !1, ~5
    5     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fn8Eko%3A5%242'
          5        ASSIGN                                                   !2, ~7
    7     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'array_search'
          8        SEND_VAR                                                 !0
          9        INIT_ARRAY                                       ~9      !0
         10        ADD_ARRAY_ELEMENT                                ~9      !1
         11        ADD_ARRAY_ELEMENT                                ~9      !2
         12        SEND_VAL                                                 ~9
         13        SEND_VAL                                                 <false>
         14        DO_ICALL                                         $10     
         15        SEND_VAR                                                 $10
         16        DO_ICALL                                                 
    8    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'array_search'
         19        SEND_VAR                                                 !1
         20        INIT_ARRAY                                       ~12     !0
         21        ADD_ARRAY_ELEMENT                                ~12     !1
         22        ADD_ARRAY_ELEMENT                                ~12     !2
         23        SEND_VAL                                                 ~12
         24        SEND_VAL                                                 <false>
         25        DO_ICALL                                         $13     
         26        SEND_VAR                                                 $13
         27        DO_ICALL                                                 
    9    28        INIT_FCALL                                               'var_dump'
         29        INIT_FCALL                                               'array_search'
         30        SEND_VAR                                                 !2
         31        INIT_ARRAY                                       ~15     !0
         32        ADD_ARRAY_ELEMENT                                ~15     !1
         33        ADD_ARRAY_ELEMENT                                ~15     !2
         34        SEND_VAL                                                 ~15
         35        SEND_VAL                                                 <false>
         36        DO_ICALL                                         $16     
         37        SEND_VAR                                                 $16
         38        DO_ICALL                                                 
   10    39        INIT_FCALL                                               'var_dump'
         40        INIT_FCALL                                               'array_search'
         41        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fn8Eko%3A10%243'
         42        SEND_VAL                                                 ~18
         43        INIT_ARRAY                                       ~19     !0
         44        ADD_ARRAY_ELEMENT                                ~19     !1
         45        ADD_ARRAY_ELEMENT                                ~19     !2
         46        SEND_VAL                                                 ~19
         47        SEND_VAL                                                 <false>
         48        DO_ICALL                                         $20     
         49        SEND_VAR                                                 $20
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fn8Eko%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n8Eko
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%2Fn8Eko%3A3%240

Function %00%7Bclosure%7D%2Fin%2Fn8Eko%3A4%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n8Eko
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%2Fn8Eko%3A4%241

Function %00%7Bclosure%7D%2Fin%2Fn8Eko%3A5%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n8Eko
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%2Fn8Eko%3A5%242

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

End of function %00%7Bclosure%7D%2Fin%2Fn8Eko%3A10%243

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.51 ms | 1400 KiB | 17 Q