3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* chdir($_SERVER{'DOCUMENT_ROOT'}."/test/"); // change working directory so that glob's output excludes the path $flvs=array_map(function($f){return basename($f,'.flv');},glob("*.flv")); // store .flv's and strip suffixes $mp4s=array_map(function($f){return basename($f,'.mp4');},glob("*.mp4")); // store .mp4's and strip suffixes $need_conversion=array_diff($flvs,$mp4s); // run ffmpeg() on these suffix-free files */ $files=['aaaa.flv','aaaa.mp4','bbbb.flv','bbbb.mp4','cccc.flv','dddd.flv','dddd.mp4']; $flvs=array_map(function($f){return basename($f,'.flv');},preg_grep('/flv$/',$files)); $mp4s=array_map(function($f){return basename($f,'.mp4');},preg_grep('/mp4$/',$files)); var_export(array_diff($flvs,$mp4s)); // just re-add the suffix ".flv" when
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nFTkq
function name:  (null)
number of ops:  29
compiled vars:  !0 = $files, !1 = $flvs, !2 = $mp4s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          3        SEND_VAL                                                 ~4
          4        INIT_FCALL                                               'preg_grep'
          5        SEND_VAL                                                 '%2Fflv%24%2F'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
   11    11        INIT_FCALL                                               'array_map'
         12        DECLARE_LAMBDA_FUNCTION                          ~8      [1]
         13        SEND_VAL                                                 ~8
         14        INIT_FCALL                                               'preg_grep'
         15        SEND_VAL                                                 '%2Fmp4%24%2F'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !2, $10
   12    21        INIT_FCALL                                               'var_export'
         22        INIT_FCALL                                               'array_diff'
         23        SEND_VAR                                                 !1
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $12     
         26        SEND_VAR                                                 $12
         27        DO_ICALL                                                 
         28      > 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/nFTkq
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'basename'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.flv'
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nFTkq
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'basename'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.mp4'
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
288.3 ms | 1020 KiB | 18 Q