3v4l.org

run code in 300+ PHP versions simultaneously
<?php function smallest($first, $second, $third) { foreach(func_get_args() as $a_parameter) { if($a_paremeter==intval($a_parameter)) // only if parameter is a number { if(!isset($maximum)) // for the first time paremeter is maximum { $maximum= $a_parameter; } if($a_parameter<$minimum) // for each parameter we check if its lower and set minimum { $minimum=$a_parameter; } } } return $minimum; } function largest($first, $second, $third) { foreach(func_get_args() as $a_parameter) { if($a_paremeter==intval($a_parameter)) // only if parameter is a number { if(!isset($maximum)) // for the first time paremeter is maximum { $maximum= $a_parameter; } if($a_parameter>$maximum) // for each parameter we check if its greater and set maximum { $maximum=$a_parameter; } } } return $maximum; } echo smallest(-1,23,900); echo largest(3,5,1000); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yoams
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   INIT_FCALL                                               'smallest'
          1        SEND_VAL                                                 -1
          2        SEND_VAL                                                 23
          3        SEND_VAL                                                 900
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
   51     6        INIT_FCALL                                               'largest'
          7        SEND_VAL                                                 3
          8        SEND_VAL                                                 5
          9        SEND_VAL                                                 1000
         10        DO_FCALL                                      0  $1      
         11        ECHO                                                     $1
   53    12      > RETURN                                                   1

Function smallest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 16
Branch analysis from position: 13
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/Yoams
function name:  smallest
number of ops:  20
compiled vars:  !0 = $first, !1 = $second, !2 = $third, !3 = $a_parameter, !4 = $a_paremeter, !5 = $maximum, !6 = $minimum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    5     3        FUNC_GET_ARGS                                    ~7      
          4      > FE_RESET_R                                       $8      ~7, ->17
          5    > > FE_FETCH_R                                               $8, !3, ->17
    8     6    >   CAST                                          4  ~9      !3
          7        IS_EQUAL                                                 !4, ~9
          8      > JMPZ                                                     ~10, ->16
   11     9    >   ISSET_ISEMPTY_CV                                 ~11     !5
         10        BOOL_NOT                                         ~12     ~11
         11      > JMPZ                                                     ~12, ->13
   13    12    >   ASSIGN                                                   !5, !3
   16    13    >   IS_SMALLER                                               !3, !6
         14      > JMPZ                                                     ~14, ->16
   18    15    >   ASSIGN                                                   !6, !3
    5    16    > > JMP                                                      ->5
         17    >   FE_FREE                                                  $8
   23    18      > RETURN                                                   !6
   24    19*     > RETURN                                                   null

End of function smallest

Function largest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 16
Branch analysis from position: 13
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/Yoams
function name:  largest
number of ops:  20
compiled vars:  !0 = $first, !1 = $second, !2 = $third, !3 = $a_parameter, !4 = $a_paremeter, !5 = $maximum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   29     3        FUNC_GET_ARGS                                    ~6      
          4      > FE_RESET_R                                       $7      ~6, ->17
          5    > > FE_FETCH_R                                               $7, !3, ->17
   32     6    >   CAST                                          4  ~8      !3
          7        IS_EQUAL                                                 !4, ~8
          8      > JMPZ                                                     ~9, ->16
   34     9    >   ISSET_ISEMPTY_CV                                 ~10     !5
         10        BOOL_NOT                                         ~11     ~10
         11      > JMPZ                                                     ~11, ->13
   36    12    >   ASSIGN                                                   !5, !3
   39    13    >   IS_SMALLER                                               !5, !3
         14      > JMPZ                                                     ~13, ->16
   41    15    >   ASSIGN                                                   !5, !3
   29    16    > > JMP                                                      ->5
         17    >   FE_FREE                                                  $7
   45    18      > RETURN                                                   !5
   46    19*     > RETURN                                                   null

End of function largest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.27 ms | 1394 KiB | 15 Q