3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scan = "00:12:a9:54:f6:a7,Privacy,-52.00,3Com,6,30:91:8f:24:07:d0,RSN: Privacy,-85.00,CenturyLink3873,1,00:0c:e5:46:2d:74,ShortSlotTime,-92.00,WLAN,1,c0:3f:0e:57:87:e8,RSN: Privacy,-94.00,Megan-PC-Wireless,6,00:12:a9:54:f6:a7,ShortPreamble,-45.00,WLAN,7"; $escan = (explode(",",$scan)); class Util { function arrayToObject() { if (is_array($array)) { foreach ($array as $name => $value) { if (!empty($name)) { if(method_exists($object, 'set'.$name)){ $object->{'set'.$name}(Util::arrayToObject($value)); }else{ if(($strict)){ if(property_exists($class, $name)){ $object->$name = Util::arrayToObject($value); } }else{ $object->$name = Util::arrayToObject($value); } } } } return $object; } else { return FALSE; } } } $device = Util::arrayToObject($escan); var_dump($device); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MtB0G
function name:  (null)
number of ops:  14
compiled vars:  !0 = $scan, !1 = $escan, !2 = $device
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '00%3A12%3Aa9%3A54%3Af6%3Aa7%2CPrivacy%2C-52.00%2C3Com%2C6%2C30%3A91%3A8f%3A24%3A07%3Ad0%2CRSN%3A+Privacy%2C-85.00%2CCenturyLink3873%2C1%2C00%3A0c%3Ae5%3A46%3A2d%3A74%2CShortSlotTime%2C-92.00%2CWLAN%2C1%2Cc0%3A3f%3A0e%3A57%3A87%3Ae8%2CRSN%3A+Privacy%2C-94.00%2CMegan-PC-Wireless%2C6%2C00%3A12%3Aa9%3A54%3Af6%3Aa7%2CShortPreamble%2C-45.00%2CWLAN%2C7'
    3     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   30     6        INIT_STATIC_METHOD_CALL                                  'Util', 'arrayToObject'
          7        SEND_VAR                                                 !1
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !2, $6
   32    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   34    13      > RETURN                                                   1

Class Util:
Function arraytoobject:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 43
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 40
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 40
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 39
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 34
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 33
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 39
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MtB0G
function name:  arrayToObject
number of ops:  45
compiled vars:  !0 = $array, !1 = $value, !2 = $name, !3 = $object, !4 = $strict, !5 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   TYPE_CHECK                                  128          !0
          1      > JMPZ                                                     ~6, ->43
    8     2    > > FE_RESET_R                                       $7      !0, ->40
          3    > > FE_FETCH_R                                       ~8      $7, !1, ->40
          4    >   ASSIGN                                                   !2, ~8
    9     5        ISSET_ISEMPTY_CV                                 ~10     !2
          6        BOOL_NOT                                         ~11     ~10
          7      > JMPZ                                                     ~11, ->39
   10     8    >   INIT_FCALL                                               'method_exists'
          9        SEND_VAR                                                 !3
         10        CONCAT                                           ~12     'set', !2
         11        SEND_VAL                                                 ~12
         12        DO_ICALL                                         $13     
         13      > JMPZ                                                     $13, ->22
   11    14    >   CONCAT                                           ~14     'set', !2
         15        INIT_METHOD_CALL                                         !3, ~14
         16        INIT_STATIC_METHOD_CALL                                  'Util', 'arrayToObject'
         17        SEND_VAR                                                 !1
         18        DO_FCALL                                      0  $15     
         19        SEND_VAR_NO_REF_EX                                       $15
         20        DO_FCALL                                      0          
         21      > JMP                                                      ->39
   13    22    > > JMPZ                                                     !4, ->34
   14    23    >   INIT_FCALL                                               'property_exists'
         24        SEND_VAR                                                 !5
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $17     
         27      > JMPZ                                                     $17, ->33
   15    28    >   INIT_STATIC_METHOD_CALL                                  'Util', 'arrayToObject'
         29        SEND_VAR                                                 !1
         30        DO_FCALL                                      0  $19     
         31        ASSIGN_OBJ                                               !3, !2
         32        OP_DATA                                                  $19
         33    > > JMP                                                      ->39
   18    34    >   INIT_STATIC_METHOD_CALL                                  'Util', 'arrayToObject'
         35        SEND_VAR                                                 !1
         36        DO_FCALL                                      0  $21     
         37        ASSIGN_OBJ                                               !3, !2
         38        OP_DATA                                                  $21
    8    39    > > JMP                                                      ->3
         40    >   FE_FREE                                                  $7
   23    41      > RETURN                                                   !3
         42*       JMP                                                      ->44
   25    43    > > RETURN                                                   <false>
   27    44*     > RETURN                                                   null

End of function arraytoobject

End of class Util.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.51 ms | 1400 KiB | 21 Q