3v4l.org

run code in 500+ PHP versions simultaneously
<?php function getLunationNumber($m, $d, $y) { $offset = 1; $synodicMonth = 29.530588861; $lunationBase = 2423436.40347; return round(((gregoriantojd($m, $d, $y) - $lunationBase ) / $synodicMonth )) + $offset; } echo getLunationNumber(1, 17, 1923).PHP_EOL; // 1 echo getLunationNumber(10, 25, 2003).PHP_EOL; // 1000
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/id67o
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'getlunationnumber'
          1        SEND_VAL                                                     1
          2        SEND_VAL                                                     17
          3        SEND_VAL                                                     1923
          4        DO_FCALL                                          0  $0      
          5        CONCAT                                               ~1      $0, '%0A'
          6        ECHO                                                         ~1
   11     7        INIT_FCALL                                                   'getlunationnumber'
          8        SEND_VAL                                                     10
          9        SEND_VAL                                                     25
         10        SEND_VAL                                                     2003
         11        DO_FCALL                                          0  $2      
         12        CONCAT                                               ~3      $2, '%0A'
         13        ECHO                                                         ~3
         14      > RETURN                                                       1

Function getlunationnumber:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/id67o
function name:  getLunationNumber
number of ops:  19
compiled vars:  !0 = $m, !1 = $d, !2 = $y, !3 = $offset, !4 = $synodicMonth, !5 = $lunationBase
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
    5     3        ASSIGN                                                       !3, 1
    6     4        ASSIGN                                                       !4, 29.5306
    7     5        ASSIGN                                                       !5, 2.42344e+6
    8     6        INIT_FCALL                                                   'round'
          7        INIT_FCALL_BY_NAME                                           'gregoriantojd'
          8        SEND_VAR_EX                                                  !0
          9        SEND_VAR_EX                                                  !1
         10        SEND_VAR_EX                                                  !2
         11        DO_FCALL                                          0  $9      
         12        SUB                                                  ~10     $9, !5
         13        DIV                                                  ~11     ~10, !4
         14        SEND_VAL                                                     ~11
         15        DO_ICALL                                             $12     
         16        ADD                                                  ~13     $12, !3
         17      > RETURN                                                       ~13
    9    18*     > RETURN                                                       null

End of function getlunationnumber

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.82 ms | 2651 KiB | 16 Q