3v4l.org

run code in 300+ PHP versions simultaneously
<?php function intdiv_2($a, $b){ return floor($a / $b); } function isBouncy($num) { if ($num < 100) { return false; } $ni = true; $nd = true; $lastDigit = $num % 10; $num = intdiv_2($num, 10); while($num != 0) { $digit = $num % 10; if ($digit > $lastDigit) { $nd = false; } else if ($digit < $lastDigit) { $ni = false; } $lastDigit = $digit; $num = intdiv_2($num, 10); } return !$ni && !$nd; } echo isBouncy(0); echo isBouncy(10); echo isBouncy(345); echo isBouncy(321); echo isBouncy(384);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZmmPL
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'isbouncy'
          1        SEND_VAL                                                 0
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   30     4        INIT_FCALL                                               'isbouncy'
          5        SEND_VAL                                                 10
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
   31     8        INIT_FCALL                                               'isbouncy'
          9        SEND_VAL                                                 345
         10        DO_FCALL                                      0  $2      
         11        ECHO                                                     $2
   32    12        INIT_FCALL                                               'isbouncy'
         13        SEND_VAL                                                 321
         14        DO_FCALL                                      0  $3      
         15        ECHO                                                     $3
   33    16        INIT_FCALL                                               'isbouncy'
         17        SEND_VAL                                                 384
         18        DO_FCALL                                      0  $4      
         19        ECHO                                                     $4
         20      > RETURN                                                   1

Function intdiv_2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZmmPL
function name:  intdiv_2
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'floor'
          3        DIV                                              ~2      !0, !1
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
    5     7*     > RETURN                                                   null

End of function intdiv_2

Function isbouncy:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 14
Branch analysis from position: 31
2 jumps found. (Code = 46) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 14
Branch analysis from position: 31
Branch analysis from position: 14
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 14
Branch analysis from position: 31
Branch analysis from position: 14
Branch analysis from position: 23
filename:       /in/ZmmPL
function name:  isBouncy
number of ops:  37
compiled vars:  !0 = $num, !1 = $ni, !2 = $nd, !3 = $lastDigit, !4 = $digit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        IS_SMALLER                                               !0, 100
          2      > JMPZ                                                     ~5, ->4
    9     3    > > RETURN                                                   <false>
   11     4    >   ASSIGN                                                   !1, <true>
   12     5        ASSIGN                                                   !2, <true>
   13     6        MOD                                              ~8      !0, 10
          7        ASSIGN                                                   !3, ~8
   14     8        INIT_FCALL                                               'intdiv_2'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 10
         11        DO_FCALL                                      0  $10     
         12        ASSIGN                                                   !0, $10
   15    13      > JMP                                                      ->29
   16    14    >   MOD                                              ~12     !0, 10
         15        ASSIGN                                                   !4, ~12
   17    16        IS_SMALLER                                               !3, !4
         17      > JMPZ                                                     ~14, ->20
   18    18    >   ASSIGN                                                   !2, <false>
         19      > JMP                                                      ->23
   20    20    >   IS_SMALLER                                               !4, !3
         21      > JMPZ                                                     ~16, ->23
   21    22    >   ASSIGN                                                   !1, <false>
   23    23    >   ASSIGN                                                   !3, !4
   24    24        INIT_FCALL                                               'intdiv_2'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 10
         27        DO_FCALL                                      0  $19     
         28        ASSIGN                                                   !0, $19
   15    29    >   IS_NOT_EQUAL                                             !0, 0
         30      > JMPNZ                                                    ~21, ->14
   26    31    >   BOOL_NOT                                         ~22     !1
         32      > JMPZ_EX                                          ~22     ~22, ->35
         33    >   BOOL_NOT                                         ~23     !2
         34        BOOL                                             ~22     ~23
         35    > > RETURN                                                   ~22
   27    36*     > RETURN                                                   null

End of function isbouncy

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.76 ms | 1403 KiB | 22 Q