3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $array = array(1, 2, 3, '{1}', '{2}', '{3}', '[1]', '[2]', '[3]'); $filtered_array = array_filter( $array, function( $el) { return preg_match( '/^\[\d+\]$/', $el); }); foreach( $filtered_array as $number) echo $number . "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/i6m5g
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array, !1 = $filtered_array, !2 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fi6m5g%3A4%240'
    6     4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
    4     6        ASSIGN                                                   !1, $5
    7     7      > FE_RESET_R                                       $7      !1, ->12
          8    > > FE_FETCH_R                                               $7, !2, ->12
          9    >   CONCAT                                           ~8      !2, '%0A'
         10        ECHO                                                     ~8
         11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $7
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fi6m5g%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i6m5g
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $el
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%5C%5B%5Cd%2B%5C%5D%24%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
    6     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fi6m5g%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.96 ms | 1395 KiB | 17 Q