3v4l.org

run code in 300+ PHP versions simultaneously
<?php $projPicsList = [ 'foobar_1.jpg', 'foobar_2.jpg', 'foobar_12.jpg', 'foobar_th1.jpg', 'foobar_th2.jpg', 'sdfaso234_33.jpg', 'foobar_th12.jpg', 'foobar_th32.jpg', 'fsdfas_th56.jpg', 'sdfiweflsdfasd24sdfsd_sdfse_th67.jpg', ]; /* $thumbs = []; foreach($projPicsList as $file) { if(preg_match('/.*_th\d+\.jpg$/' , $file)) { $thumbs[] = $file; } }*/ $thumbs = array_filter($projPicsList, function($item){ return preg_match('/.*_th\d+\.jpg$/' , $item); }); print_r($thumbs);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vKXOp
function name:  (null)
number of ops:  11
compiled vars:  !0 = $projPicsList, !1 = $thumbs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   23     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvKXOp%3A23%240'
   25     4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
   23     6        ASSIGN                                                   !1, $4
   26     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FvKXOp%3A23%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.32 ms | 1395 KiB | 19 Q