3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1, "apples",2, "oranges",3, "plums"); // array_filter() $lambda = function( $item ) { if ( ctype_alpha($item) ) { return true; } }; $filtered = array_filter( $array, $lambda); var_dump($filtered); // using array_map() $callback = function($item) { return strtoupper($item); }; $nu = array_map( $callback, $array); var_dump($nu); // array_walk() $f = function(&$item,$key,$prefix) { $item = "$prefix: $item"; }; array_walk($array, $f, 'phun'); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CIH8m
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array, !1 = $lambda, !2 = $filtered, !3 = $callback, !4 = $nu, !5 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCIH8m%3A5%240'
          2        ASSIGN                                                   !1, ~7
   10     3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
   11     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   14    11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCIH8m%3A14%241'
         12        ASSIGN                                                   !3, ~12
   17    13        INIT_FCALL                                               'array_map'
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $14     
         17        ASSIGN                                                   !4, $14
   18    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
   21    21        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCIH8m%3A21%242'
         22        ASSIGN                                                   !5, ~17
   24    23        INIT_FCALL                                               'array_walk'
         24        SEND_REF                                                 !0
         25        SEND_VAR                                                 !5
         26        SEND_VAL                                                 'phun'
         27        DO_ICALL                                                 
   25    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FCIH8m%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CIH8m
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'ctype_alpha'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->6
    7     5    > > RETURN                                                   <true>
    9     6    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FCIH8m%3A5%240

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

End of function %00%7Bclosure%7D%2Fin%2FCIH8m%3A14%241

Function %00%7Bclosure%7D%2Fin%2FCIH8m%3A21%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CIH8m
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $item, !1 = $key, !2 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   22     3        ROPE_INIT                                     3  ~4      !2
          4        ROPE_ADD                                      1  ~4      ~4, '%3A+'
          5        ROPE_END                                      2  ~3      ~4, !0
          6        ASSIGN                                                   !0, ~3
   23     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FCIH8m%3A21%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.43 ms | 1392 KiB | 25 Q