3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = array( array('w' => '100', 'h'=>'100'), array('w' => '200', 'h'=>'200'), array('w' => 300, 'h'=>300), ); $new_values = ''; foreach($values as $value) { $new_values[] = json_encode(array($value['w'], $value['h'])); } echo implode(',', $new_values); // [100,100],[200,200],[300,300]
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/OnJVu
function name:  (null)
number of ops:  21
compiled vars:  !0 = $values, !1 = $new_values, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, ''
   10     2      > FE_RESET_R                                       $5      !0, ->14
          3    > > FE_FETCH_R                                               $5, !2, ->14
   11     4    >   INIT_FCALL                                               'json_encode'
          5        FETCH_DIM_R                                      ~7      !2, 'w'
          6        INIT_ARRAY                                       ~8      ~7
          7        FETCH_DIM_R                                      ~9      !2, 'h'
          8        ADD_ARRAY_ELEMENT                                ~8      ~9
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $10     
         11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  $10
   10    13      > JMP                                                      ->3
         14    >   FE_FREE                                                  $5
   14    15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '%2C'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $11     
         19        ECHO                                                     $11
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.78 ms | 1395 KiB | 17 Q