3v4l.org

run code in 300+ PHP versions simultaneously
<?php //formula: function numSms ($chaCount) { $sms = 1; if($chaCount > 160) { $sms += floor(($chaCount - 160) / 153); //add on the whole number of extra SMSs needed $sms += ceil((($chaCount - 160) % 153) / 153); //with the remainder, work out how many are needed (atypically, just one) } return $sms; } var_dump(numSms(305)); var_dump(numSms(306)); var_dump(numSms(307));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l0BEk
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'numsms'
          2        SEND_VAL                                                 305
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   17     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'numsms'
          8        SEND_VAL                                                 306
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   18    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'numsms'
         14        SEND_VAL                                                 307
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function numsms:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/l0BEk
function name:  numSms
number of ops:  19
compiled vars:  !0 = $chaCount, !1 = $sms
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, 1
    7     2        IS_SMALLER                                               160, !0
          3      > JMPZ                                                     ~3, ->17
    8     4    >   INIT_FCALL                                               'floor'
          5        SUB                                              ~4      !0, 160
          6        DIV                                              ~5      ~4, 153
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                         $6      
          9        ASSIGN_OP                                     1          !1, $6
    9    10        INIT_FCALL                                               'ceil'
         11        SUB                                              ~8      !0, 160
         12        MOD                                              ~9      ~8, 153
         13        DIV                                              ~10     ~9, 153
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                         $11     
         16        ASSIGN_OP                                     1          !1, $11
   12    17    > > RETURN                                                   !1
   13    18*     > RETURN                                                   null

End of function numsms

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.32 ms | 1398 KiB | 22 Q