3v4l.org

run code in 300+ PHP versions simultaneously
<?php $servers = ["one","two","tree","four"]; function isServerDown($server) { return $server === 'tree'; } for ($i = 0, $count = count($servers); $i < $count; ++$i) { $server = $servers[(int)$i]; printf("Key=%d VAL=%s\n", $i, $server); $i = isServerDown($server) ? $i - .9 : (int)$i; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 5
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 5
Branch analysis from position: 26
Branch analysis from position: 5
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 5
Branch analysis from position: 26
Branch analysis from position: 5
filename:       /in/uuLMu
function name:  (null)
number of ops:  27
compiled vars:  !0 = $servers, !1 = $i, !2 = $count, !3 = $server
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 0
          2        COUNT                                            ~6      !0
          3        ASSIGN                                                   !2, ~6
          4      > JMP                                                      ->24
   10     5    >   CAST                                          4  ~8      !1
          6        FETCH_DIM_R                                      ~9      !0, ~8
          7        ASSIGN                                                   !3, ~9
   11     8        INIT_FCALL                                               'printf'
          9        SEND_VAL                                                 'Key%3D%25d+VAL%3D%25s%0A'
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                                 
   12    13        INIT_FCALL                                               'isserverdown'
         14        SEND_VAR                                                 !3
         15        DO_FCALL                                      0  $12     
         16      > JMPZ                                                     $12, ->20
         17    >   SUB                                              ~13     !1, 0.9
         18        QM_ASSIGN                                        ~14     ~13
         19      > JMP                                                      ->22
         20    >   CAST                                          4  ~15     !1
         21        QM_ASSIGN                                        ~14     ~15
         22    >   ASSIGN                                                   !1, ~14
    9    23        PRE_INC                                                  !1
         24    >   IS_SMALLER                                               !1, !2
         25      > JMPNZ                                                    ~18, ->5
   13    26    > > RETURN                                                   1

Function isserverdown:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uuLMu
function name:  isServerDown
number of ops:  4
compiled vars:  !0 = $server
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        IS_IDENTICAL                                     ~1      !0, 'tree'
          2      > RETURN                                                   ~1
    7     3*     > RETURN                                                   null

End of function isserverdown

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.43 ms | 1013 KiB | 15 Q