3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* every day amount increases by £19,000 */ function getAmount() { $increment = 19000; return getTodayValue($increment); } /* every users increases by 514 */ function getUsers() { $increment = 514; return getTodayValue($increment); } function getTodayValue($inc) { $startDay = "2013-11-01"; $endDay = "2013-12-31"; $now = date('Y-m-d'); $startDay = ($now >= $startDay) ? $now : $startDay; $endDay = ($now <= $endDay) ? $now : $endDay; $diff = abs(strtotime($endDay) - strtotime($startDay)); $days = ($diff/(60*60*24))+1; return number_format($days*$inc); } echo(getUsers());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SfnLQ
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_FCALL                                               'getusers'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function getamount:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SfnLQ
function name:  getAmount
number of ops:  6
compiled vars:  !0 = $increment
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 19000
    8     1        INIT_FCALL_BY_NAME                                       'getTodayValue'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4      > RETURN                                                   $2
    9     5*     > RETURN                                                   null

End of function getamount

Function getusers:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SfnLQ
function name:  getUsers
number of ops:  6
compiled vars:  !0 = $increment
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 514
   15     1        INIT_FCALL_BY_NAME                                       'getTodayValue'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4      > RETURN                                                   $2
   16     5*     > RETURN                                                   null

End of function getusers

Function gettodayvalue:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
Branch analysis from position: 17
filename:       /in/SfnLQ
function name:  getTodayValue
number of ops:  39
compiled vars:  !0 = $inc, !1 = $startDay, !2 = $endDay, !3 = $now, !4 = $diff, !5 = $days
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        ASSIGN                                                   !1, '2013-11-01'
   20     2        ASSIGN                                                   !2, '2013-12-31'
   21     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'Y-m-d'
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !3, $8
   23     7        IS_SMALLER_OR_EQUAL                                      !1, !3
          8      > JMPZ                                                     ~10, ->11
          9    >   QM_ASSIGN                                        ~11     !3
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~11     !1
         12    >   ASSIGN                                                   !1, ~11
   24    13        IS_SMALLER_OR_EQUAL                                      !3, !2
         14      > JMPZ                                                     ~13, ->17
         15    >   QM_ASSIGN                                        ~14     !3
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~14     !2
         18    >   ASSIGN                                                   !2, ~14
   26    19        INIT_FCALL                                               'abs'
         20        INIT_FCALL                                               'strtotime'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $16     
         23        INIT_FCALL                                               'strtotime'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $17     
         26        SUB                                              ~18     $16, $17
         27        SEND_VAL                                                 ~18
         28        DO_ICALL                                         $19     
         29        ASSIGN                                                   !4, $19
   27    30        DIV                                              ~21     !4, 86400
         31        ADD                                              ~22     ~21, 1
         32        ASSIGN                                                   !5, ~22
   28    33        INIT_FCALL                                               'number_format'
         34        MUL                                              ~24     !5, !0
         35        SEND_VAL                                                 ~24
         36        DO_ICALL                                         $25     
         37      > RETURN                                                   $25
   29    38*     > RETURN                                                   null

End of function gettodayvalue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.96 ms | 1403 KiB | 22 Q