3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "[[1500000000,2823.43,2848,2827.86,2847.68,526.4426911499979]]"; $str2 = substr($str,1,-1); $arr = []; preg_replace_callback('/\[(.*?)\]/', function($m) use (&$arr){ $arr[] = explode(',',preg_replace('/([\w]+)/', "$1", $m[1])); }, $str2); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ilf6Y
function name:  (null)
number of ops:  19
compiled vars:  !0 = $str, !1 = $str2, !2 = $arr
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        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 1
          4        SEND_VAL                                                 -1
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    5     7        ASSIGN                                                   !2, <array>
    6     8        INIT_FCALL                                               'preg_replace_callback'
          9        SEND_VAL                                                 '%2F%5C%5B%28.%2A%3F%29%5C%5D%2F'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Filf6Y%3A6%240'
         11        BIND_LEXICAL                                             ~7, !2
    8    12        SEND_VAL                                                 ~7
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
    9    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Filf6Y%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ilf6Y
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $m, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    7     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
    8    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Filf6Y%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.5 ms | 1400 KiB | 23 Q