3v4l.org

run code in 300+ PHP versions simultaneously
<?php $first = 34; //$_GET['first']; $second = -55; //$_GET['second']; $third = 90; //$_GET['third']; //Your code here function smallest($first, $second, $third) { foreach(func_get_args() as $a_parameter) { if($a_parameter==intval($a_parameter)) // only if parameter is a number { if(!isset($minimum)) // for the first time paremeter is maximum { $minimum= $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_parameter==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; } $largest_number = largest($first, $second, $third); $smallest_number = smallest($first, $second, $third); echo "From the numbers you typed, the largest was $largest_number"; echo " and smallest $smallest_number"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qh0YA
function name:  (null)
number of ops:  22
compiled vars:  !0 = $first, !1 = $second, !2 = $third, !3 = $largest_number, !4 = $smallest_number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 34
    3     1        ASSIGN                                                   !1, -55
    4     2        ASSIGN                                                   !2, 90
   57     3        INIT_FCALL                                               'largest'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !3, $8
   58     9        INIT_FCALL                                               'smallest'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                                   !4, $10
   60    15        NOP                                                      
         16        FAST_CONCAT                                      ~12     'From+the+numbers+you+typed%2C+the+largest+was+', !3
         17        ECHO                                                     ~12
   61    18        NOP                                                      
         19        FAST_CONCAT                                      ~13     '+and+smallest+', !4
         20        ECHO                                                     ~13
   63    21      > 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/Qh0YA
function name:  smallest
number of ops:  20
compiled vars:  !0 = $first, !1 = $second, !2 = $third, !3 = $a_parameter, !4 = $minimum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   13     3        FUNC_GET_ARGS                                    ~5      
          4      > FE_RESET_R                                       $6      ~5, ->17
          5    > > FE_FETCH_R                                               $6, !3, ->17
   16     6    >   CAST                                          4  ~7      !3
          7        IS_EQUAL                                                 !3, ~7
          8      > JMPZ                                                     ~8, ->16
   19     9    >   ISSET_ISEMPTY_CV                                 ~9      !4
         10        BOOL_NOT                                         ~10     ~9
         11      > JMPZ                                                     ~10, ->13
   21    12    >   ASSIGN                                                   !4, !3
   24    13    >   IS_SMALLER                                               !3, !4
         14      > JMPZ                                                     ~12, ->16
   26    15    >   ASSIGN                                                   !4, !3
   13    16    > > JMP                                                      ->5
         17    >   FE_FREE                                                  $6
   31    18      > RETURN                                                   !4
   32    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/Qh0YA
function name:  largest
number of ops:  20
compiled vars:  !0 = $first, !1 = $second, !2 = $third, !3 = $a_parameter, !4 = $maximum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   37     3        FUNC_GET_ARGS                                    ~5      
          4      > FE_RESET_R                                       $6      ~5, ->17
          5    > > FE_FETCH_R                                               $6, !3, ->17
   40     6    >   CAST                                          4  ~7      !3
          7        IS_EQUAL                                                 !3, ~7
          8      > JMPZ                                                     ~8, ->16
   42     9    >   ISSET_ISEMPTY_CV                                 ~9      !4
         10        BOOL_NOT                                         ~10     ~9
         11      > JMPZ                                                     ~10, ->13
   44    12    >   ASSIGN                                                   !4, !3
   47    13    >   IS_SMALLER                                               !4, !3
         14      > JMPZ                                                     ~12, ->16
   49    15    >   ASSIGN                                                   !4, !3
   37    16    > > JMP                                                      ->5
         17    >   FE_FREE                                                  $6
   53    18      > RETURN                                                   !4
   54    19*     > RETURN                                                   null

End of function largest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.06 ms | 1403 KiB | 15 Q