3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function Number2Date($number) { $seconds = '00'; $minutes = '00'; $hours = '00'; if(strpos($number, '.')) { $arr = explode(".", $number); $hours = $arr[0]; $minutes = 60 * ($arr[1] / 10); } else { $hours = $number; } return $hours.":".$minutes.":".$seconds; } echo Number2Date(48.5); ?>
based on eHnjl
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/5Ch5r
function name:  (null)
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  15     1        INIT_FCALL                                               'number2date'
         2        SEND_VAL                                                 48.5
         3        DO_FCALL                                      0  $0      
         4        ECHO                                                     $0
         5      > RETURN                                                   1

Function number2date:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
Jump found. Position 1 = 22
Branch analysis from position: 22
Jump found. Position 1 = -2
Branch analysis from position: 21
Jump found. Position 1 = -2
filename:       /in/5Ch5r
function name:  Number2Date
number of ops:  28
compiled vars:  !0 = $number, !1 = $seconds, !2 = $minutes, !3 = $hours, !4 = $arr
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   RECV                                             !0      
   3     1        ASSIGN                                                   !1, '00'
   4     2        ASSIGN                                                   !2, '00'
   5     3        ASSIGN                                                   !3, '00'
   6     4        INIT_FCALL                                               'strpos'
         5        SEND_VAR                                                 !0
         6        SEND_VAL                                                 '.'
         7        DO_ICALL                                         $8      
         8      > JMPZ                                                     $8, ->21
   7     9    >   INIT_FCALL                                               'explode'
        10        SEND_VAL                                                 '.'
        11        SEND_VAR                                                 !0
        12        DO_ICALL                                         $9      
        13        ASSIGN                                                   !4, $9
   8    14        FETCH_DIM_R                                      $11     !4, 0
        15        ASSIGN                                                   !3, $11
   9    16        FETCH_DIM_R                                      $13     !4, 1
        17        DIV                                              ~14     $13, 10
        18        MUL                                              ~15     60, ~14
        19        ASSIGN                                                   !2, ~15
        20      > JMP                                                      ->22
  11    21    >   ASSIGN                                                   !3, !0
  13    22    >   CONCAT                                           ~18     !3, '%3A'
        23        CONCAT                                           ~19     ~18, !2
        24        CONCAT                                           ~20     ~19, '%3A'
        25        CONCAT                                           ~21     ~20, !1
        26      > RETURN                                                   ~21
  14    27*     > RETURN                                                   null

End of function number2date

Generated using Vulcan Logic Dumper, using php 7.3.0