3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "[[1500000000,2823.43,2848,2827.86,2847.68,526.4426911499979]]"; $arr = []; preg_replace_callback('/\[(.*?)\]/', function($m) use (&$arr){ $arr[] = explode(',',preg_replace('/([\w]+)/', "$1", $m[1])); }, $str); $arr2 = []; preg_replace_callback('/\[(.*?)\]/', function($m) use (&$arr2){ $arr2[] = explode(',',preg_replace('/([\w]+)/', "$1", $m[1])); }, $str); print_r($arr2); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZqRHp
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str, !1 = $arr, !2 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%5B1500000000%2C2823.43%2C2848%2C2827.86%2C2847.68%2C526.4426911499979%5D%5D'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%2F%5C%5B%28.%2A%3F%29%5C%5D%2F'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZqRHp%3A5%240'
          5        BIND_LEXICAL                                             ~5, !1
    7     6        SEND_VAL                                                 ~5
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    8     9        ASSIGN                                                   !2, <array>
    9    10        INIT_FCALL                                               'preg_replace_callback'
         11        SEND_VAL                                                 '%2F%5C%5B%28.%2A%3F%29%5C%5D%2F'
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZqRHp%3A9%241'
         13        BIND_LEXICAL                                             ~8, !2
   11    14        SEND_VAL                                                 ~8
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   12    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   13    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZqRHp%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZqRHp
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $m, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%2F%28%5B%5Cw%5D%2B%29%2F'
          6        SEND_VAL                                                 '%241'
          7        FETCH_DIM_R                                      ~3      !0, 1
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                         $5      
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  $5
    7    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZqRHp%3A5%240

Function %00%7Bclosure%7D%2Fin%2FZqRHp%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZqRHp
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $m, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   10     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%2F%28%5B%5Cw%5D%2B%29%2F'
          6        SEND_VAL                                                 '%241'
          7        FETCH_DIM_R                                      ~3      !0, 1
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                         $5      
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  $5
   11    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZqRHp%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.38 ms | 1400 KiB | 23 Q