3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isDivisible_x_3($n) { if (strlen($n) == 3){ list($a,$b,$c) = str_split($n); if ($b == $a + 1 && $c == $b + 1){ $mess = "\n$n is divisible by three\n"; $mess .= "\nProof: \$n/3 == " . $n/3; return $mess; } } } $num = 234; echo isDivisible_x_3( $num );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GdiRb
function name:  (null)
number of ops:  6
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 234
   15     1        INIT_FCALL                                               'isdivisible_x_3'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function isdivisible_x_3:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 29
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 29
filename:       /in/GdiRb
function name:  isDivisible_x_3
number of ops:  30
compiled vars:  !0 = $n, !1 = $a, !2 = $b, !3 = $c, !4 = $mess
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        STRLEN                                           ~5      !0
          2        IS_EQUAL                                                 ~5, 3
          3      > JMPZ                                                     ~6, ->29
    6     4    >   INIT_FCALL                                               'str_split'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $7      
          7        FETCH_LIST_R                                     $8      $7, 0
          8        ASSIGN                                                   !1, $8
          9        FETCH_LIST_R                                     $10     $7, 1
         10        ASSIGN                                                   !2, $10
         11        FETCH_LIST_R                                     $12     $7, 2
         12        ASSIGN                                                   !3, $12
         13        FREE                                                     $7
    7    14        ADD                                              ~14     !1, 1
         15        IS_EQUAL                                         ~15     !2, ~14
         16      > JMPZ_EX                                          ~15     ~15, ->20
         17    >   ADD                                              ~16     !2, 1
         18        IS_EQUAL                                         ~17     !3, ~16
         19        BOOL                                             ~15     ~17
         20    > > JMPZ                                                     ~15, ->29
    8    21    >   ROPE_INIT                                     3  ~19     '%0A'
         22        ROPE_ADD                                      1  ~19     ~19, !0
         23        ROPE_END                                      2  ~18     ~19, '+is+divisible+by+three%0A'
         24        ASSIGN                                                   !4, ~18
    9    25        DIV                                              ~22     !0, 3
         26        CONCAT                                           ~23     '%0AProof%3A+%24n%2F3+%3D%3D+', ~22
         27        ASSIGN_OP                                     8          !4, ~23
   10    28      > RETURN                                                   !4
   13    29    > > RETURN                                                   null

End of function isdivisible_x_3

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.55 ms | 1407 KiB | 16 Q