3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sunTimes($lat, $long, $date) { date_default_timezone_set('UTC'); $sun_info = date_sun_info(strtotime($date), $lat, $long); $sunrise = date("H:i:s", $sun_info['sunrise']); $sunset = date("H:i:s", $sun_info['sunset']); return "on $date sun rises at $sunrise and sets at $sunset"; } echo sunTimes(51.5, 0, '2018-03-14'); // ~London
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31aER
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'suntimes'
          1        SEND_VAL                                                 51.5
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 '2018-03-14'
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
          6      > RETURN                                                   1

Function suntimes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31aER
function name:  sunTimes
number of ops:  35
compiled vars:  !0 = $lat, !1 = $long, !2 = $date, !3 = $sun_info, !4 = $sunrise, !5 = $sunset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    5     3        INIT_FCALL                                               'date_default_timezone_set'
          4        SEND_VAL                                                 'UTC'
          5        DO_ICALL                                                 
    7     6        INIT_FCALL                                               'date_sun_info'
          7        INIT_FCALL                                               'strtotime'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !3, $8
    9    15        INIT_FCALL                                               'date'
         16        SEND_VAL                                                 'H%3Ai%3As'
         17        FETCH_DIM_R                                      ~10     !3, 'sunrise'
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !4, $11
   10    21        INIT_FCALL                                               'date'
         22        SEND_VAL                                                 'H%3Ai%3As'
         23        FETCH_DIM_R                                      ~13     !3, 'sunset'
         24        SEND_VAL                                                 ~13
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !5, $14
   12    27        ROPE_INIT                                     6  ~17     'on+'
         28        ROPE_ADD                                      1  ~17     ~17, !2
         29        ROPE_ADD                                      2  ~17     ~17, '+sun+rises+at+'
         30        ROPE_ADD                                      3  ~17     ~17, !4
         31        ROPE_ADD                                      4  ~17     ~17, '+and+sets+at+'
         32        ROPE_END                                      5  ~16     ~17, !5
         33      > RETURN                                                   ~16
   13    34*     > RETURN                                                   null

End of function suntimes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.29 ms | 1403 KiB | 22 Q