3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results['effects'] = array ( 0 => array ( 'label' => 'Euphoric', 'value' => 'width:100%', ), 1 => array ( 'label' => 'Relaxed', 'value' => 'width:100%', ), 2 => array ( 'label' => 'Uplifted', 'value' => 'width:92.0634920634921%', ), 3 => array ( 'label' => 'Happy', 'value' => 'width:86.7724867724868%', ), 4 => array ( 'label' => 'Creative', 'value' => 'width:84.1269841269841%', ), 5 => array ( 'label' => 'Stress', 'value' => 'width:100%', ), 6 => array ( 'label' => 'Lack of Appetite', 'value' => 'width:82.7586206896552%', ), 7 => array ( 'label' => 'Insomnia', 'value' => 'width:28.735632183908%', ), 8 => array ( 'label' => 'Muscle Spasms', 'value' => 'width:28.735632183908%', ), 9 => array ( 'label' => 'Pain', 'value' => 'width:28.735632183908%', ), 10 => array ( 'label' => 'Dry Eyes', 'value' => 'width:100%', ), 11 => array ( 'label' => 'Dizzy', 'value' => 'width:66.6666666666667%', ), 12 => array ( 'label' => 'Paranoid', 'value' => 'width:66.6666666666667%', ), 13 => array ( 'label' => 'Dry Mouth', 'value' => 'width:66.6666666666667%', ), ); if (isset($results['effects'])){ if (isset($results['effects'][0]['value'])){ $i = 0; $effectsArray = array(); foreach ($results['effects'] as $effect) { $effectsArray[] = [ 'label' => $effect['label'], 'value' => str_replace("width:", "", $effect['value']) ]; } } } var_dump($effectsArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 26
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 26
Branch analysis from position: 26
filename:       /in/Xq692
function name:  (null)
number of ops:  30
compiled vars:  !0 = $results, !1 = $i, !2 = $effectsArray, !3 = $effect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 'effects'
    6     1        OP_DATA                                                  <array>
   76     2        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'effects'
          3      > JMPZ                                                     ~5, ->26
   77     4    >   FETCH_DIM_IS                                     ~6      !0, 'effects'
          5        FETCH_DIM_IS                                     ~7      ~6, 0
          6        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, 'value'
          7      > JMPZ                                                     ~8, ->26
   78     8    >   ASSIGN                                                   !1, 0
   79     9        ASSIGN                                                   !2, <array>
   81    10        FETCH_DIM_R                                      ~11     !0, 'effects'
         11      > FE_RESET_R                                       $12     ~11, ->25
         12    > > FE_FETCH_R                                               $12, !3, ->25
   83    13    >   FETCH_DIM_R                                      ~14     !3, 'label'
         14        INIT_ARRAY                                       ~15     ~14, 'label'
   84    15        INIT_FCALL                                               'str_replace'
         16        SEND_VAL                                                 'width%3A'
         17        SEND_VAL                                                 ''
         18        FETCH_DIM_R                                      ~16     !3, 'value'
         19        SEND_VAL                                                 ~16
         20        DO_ICALL                                         $17     
         21        ADD_ARRAY_ELEMENT                                ~15     $17, 'value'
   82    22        ASSIGN_DIM                                               !2
   84    23        OP_DATA                                                  ~15
   81    24      > JMP                                                      ->12
         25    >   FE_FREE                                                  $12
   90    26    >   INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.11 ms | 944 KiB | 18 Q