3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userInfo = array('city' => 0); function isNull($userInfo,$id){ If($userInfo[$id] == 0){ $res = "Не указано"; } else{ if($id == 'city'){ $res = $userInfo[$id]->title; }else{ $res = $userInfo[$id]; } } return $res; } $city = isNull($userInfo,"city"); echo $city;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7BUCh
function name:  (null)
number of ops:  8
compiled vars:  !0 = $userInfo, !1 = $city
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'isnull'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'city'
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !1, $3
   17     6        ECHO                                                     !1
          7      > RETURN                                                   1

Function isnull:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7BUCh
function name:  isNull
number of ops:  17
compiled vars:  !0 = $userInfo, !1 = $id, !2 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        FETCH_DIM_R                                      ~3      !0, !1
          3        IS_EQUAL                                                 ~3, 0
          4      > JMPZ                                                     ~4, ->7
    5     5    >   ASSIGN                                                   !2, '%D0%9D%D0%B5+%D1%83%D0%BA%D0%B0%D0%B7%D0%B0%D0%BD%D0%BE'
          6      > JMP                                                      ->15
    8     7    >   IS_EQUAL                                                 !1, 'city'
          8      > JMPZ                                                     ~6, ->13
    9     9    >   FETCH_DIM_R                                      ~7      !0, !1
         10        FETCH_OBJ_R                                      ~8      ~7, 'title'
         11        ASSIGN                                                   !2, ~8
         12      > JMP                                                      ->15
   11    13    >   FETCH_DIM_R                                      ~10     !0, !1
         14        ASSIGN                                                   !2, ~10
   14    15    > > RETURN                                                   !2
   15    16*     > RETURN                                                   null

End of function isnull

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.53 ms | 1399 KiB | 14 Q