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

End of function arraytoobject

End of class Util.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.67 ms | 1400 KiB | 21 Q