3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gallery_columns($content){ $columns = 4; $pattern = array( '/([gallery(.*?)columns="([0-9])"(.*?)])/ie', '/([gallery])/ie', '/([gallery(.*?)])/ie' ); $replace = 'stripslashes(strstr("1", "columns="$columns"") ? "1" : "[gallery 2 4 columns="$columns"]")'; return preg_replace($pattern, $replace, $content); } echo gallery_columns('[gallery ids="1,2,3,4"]'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JXATL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'gallery_columns'
          1        SEND_VAL                                                 '%5Bgallery+ids%3D%221%2C2%2C3%2C4%22%5D'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   18     4      > RETURN                                                   1

Function gallery_columns:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JXATL
function name:  gallery_columns
number of ops:  11
compiled vars:  !0 = $content, !1 = $columns, !2 = $pattern, !3 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 4
    5     2        ASSIGN                                                   !2, <array>
   10     3        ASSIGN                                                   !3, 'stripslashes%28strstr%28%221%22%2C+%22columns%3D%22%24columns%22%22%29+%3F+%221%22+%3A+%22%5Bgallery+2+4+columns%3D%22%24columns%22%5D%22%29'
   13     4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !3
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $7      
          9      > RETURN                                                   $7
   14    10*     > RETURN                                                   null

End of function gallery_columns

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.74 ms | 1397 KiB | 16 Q