3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = 'key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47'; $itemsOverFifty = []; if(preg_match_all('/age=(?<age>\d+)/', $data, $matches)) { $itemsOverFifty = array_filter($matches['age'], fn($item) => $item >= 50 ); } echo count($itemsOverFifty);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/8eqnR
function name:  (null)
number of ops:  18
compiled vars:  !0 = $data, !1 = $itemsOverFifty, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'key%3DIAfpK%2C+age%3D58%2C+key%3DWNVdi%2C+age%3D64%2C+key%3Djp9zt%2C+age%3D47'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%2Fage%3D%28%3F%3Cage%3E%5Cd%2B%29%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->15
    6     8    >   INIT_FCALL                                               'array_filter'
          9        FETCH_DIM_R                                      ~6      !2, 'age'
         10        SEND_VAL                                                 ~6
         11        DECLARE_LAMBDA_FUNCTION                          ~7      [0]
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
    9    15    >   COUNT                                            ~10     !1
         16        ECHO                                                     ~10
         17      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8eqnR
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        IS_SMALLER_OR_EQUAL                              ~1      50, !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.94 ms | 1011 KiB | 15 Q