3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "1,2,3"; $array = explode(',', $string); var_dump($array); echo "\n---\n"; array_walk($array, function(int &$int){;}); var_dump($array); echo "\n---\n"; var_dump( array_map(function(int $i){ return $i; }, explode(',', $string)) ); echo "\n---\n"; var_dump( array_map(fn(int $i) => $i, explode(',', $string)) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sd2cp
function name:  (null)
number of ops:  45
compiled vars:  !0 = $string, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1%2C2%2C3'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    7     9        ECHO                                                     '%0A---%0A'
    8    10        INIT_FCALL                                               'array_walk'
         11        SEND_REF                                                 !1
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fsd2cp%3A8%240'
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                                 
    9    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   11    18        ECHO                                                     '%0A---%0A'
   12    19        INIT_FCALL                                               'var_dump'
   13    20        INIT_FCALL                                               'array_map'
         21        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fsd2cp%3A13%241'
         22        SEND_VAL                                                 ~9
         23        INIT_FCALL                                               'explode'
         24        SEND_VAL                                                 '%2C'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $10     
         27        SEND_VAR                                                 $10
         28        DO_ICALL                                         $11     
         29        SEND_VAR                                                 $11
         30        DO_ICALL                                                 
   16    31        ECHO                                                     '%0A---%0A'
   17    32        INIT_FCALL                                               'var_dump'
   18    33        INIT_FCALL                                               'array_map'
         34        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fsd2cp%3A18%242'
         35        SEND_VAL                                                 ~13
         36        INIT_FCALL                                               'explode'
         37        SEND_VAL                                                 '%2C'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                         $14     
         40        SEND_VAR                                                 $14
         41        DO_ICALL                                         $15     
         42        SEND_VAR                                                 $15
         43        DO_ICALL                                                 
   19    44      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2Fsd2cp%3A8%240

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

End of function %00%7Bclosure%7D%2Fin%2Fsd2cp%3A13%241

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

End of function %00%7Bclosure%7D%2Fin%2Fsd2cp%3A18%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.38 ms | 1405 KiB | 21 Q