3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "name='John';phone='555-5555';city='oakland';"; $string2 = "city='oakland';phone='555-5555';name='John';"; $string3 = "phone='555-5555';name='John';city='oakland';"; $array = explode(';',$string3); sort($array); $array = array_filter($array); foreach($array as $value){ $split = explode('=',$value); $result[$split[0]] = $split[1]; } extract($result); echo "\$city = $city; \$name = $name; \$phone = $phone";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/RB8pT
function name:  (null)
number of ops:  39
compiled vars:  !0 = $string, !1 = $string2, !2 = $string3, !3 = $array, !4 = $value, !5 = $split, !6 = $result, !7 = $city, !8 = $name, !9 = $phone
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'name%3D%27John%27%3Bphone%3D%27555-5555%27%3Bcity%3D%27oakland%27%3B'
    4     1        ASSIGN                                                   !1, 'city%3D%27oakland%27%3Bphone%3D%27555-5555%27%3Bname%3D%27John%27%3B'
    5     2        ASSIGN                                                   !2, 'phone%3D%27555-5555%27%3Bname%3D%27John%27%3Bcity%3D%27oakland%27%3B'
    7     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%3B'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $13     
          7        ASSIGN                                                   !3, $13
    8     8        INIT_FCALL                                               'sort'
          9        SEND_REF                                                 !3
         10        DO_ICALL                                                 
    9    11        INIT_FCALL                                               'array_filter'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $16     
         14        ASSIGN                                                   !3, $16
   10    15      > FE_RESET_R                                       $18     !3, ->27
         16    > > FE_FETCH_R                                               $18, !4, ->27
   11    17    >   INIT_FCALL                                               'explode'
         18        SEND_VAL                                                 '%3D'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $19     
         21        ASSIGN                                                   !5, $19
   12    22        FETCH_DIM_R                                      ~21     !5, 0
         23        FETCH_DIM_R                                      ~23     !5, 1
         24        ASSIGN_DIM                                               !6, ~21
         25        OP_DATA                                                  ~23
   10    26      > JMP                                                      ->16
         27    >   FE_FREE                                                  $18
   14    28        INIT_FCALL                                               'extract'
         29        SEND_REF                                                 !6
         30        DO_ICALL                                                 
   15    31        ROPE_INIT                                     6  ~26     '%24city+%3D+'
         32        ROPE_ADD                                      1  ~26     ~26, !7
         33        ROPE_ADD                                      2  ~26     ~26, '%3B+%24name+%3D+'
         34        ROPE_ADD                                      3  ~26     ~26, !8
         35        ROPE_ADD                                      4  ~26     ~26, '%3B+%24phone+%3D+'
         36        ROPE_END                                      5  ~25     ~26, !9
         37        ECHO                                                     ~25
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.57 ms | 1018 KiB | 17 Q