3v4l.org

run code in 300+ PHP versions simultaneously
<?php $first = $_GET['first']; $second = $_GET['second']; $third = $_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/JNBTC
function name:  (null)
number of ops:  28
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 >   FETCH_R                      global              ~5      '_GET'
          1        FETCH_DIM_R                                      ~6      ~5, 'first'
          2        ASSIGN                                                   !0, ~6
    3     3        FETCH_R                      global              ~8      '_GET'
          4        FETCH_DIM_R                                      ~9      ~8, 'second'
          5        ASSIGN                                                   !1, ~9
    4     6        FETCH_R                      global              ~11     '_GET'
          7        FETCH_DIM_R                                      ~12     ~11, 'third'
          8        ASSIGN                                                   !2, ~12
   57     9        INIT_FCALL                                               'largest'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_FCALL                                      0  $14     
         14        ASSIGN                                                   !3, $14
   58    15        INIT_FCALL                                               'smallest'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !2
         19        DO_FCALL                                      0  $16     
         20        ASSIGN                                                   !4, $16
   60    21        NOP                                                      
         22        FAST_CONCAT                                      ~18     'From+the+numbers+you+typed%2C+the+largest+was+', !3
         23        ECHO                                                     ~18
   61    24        NOP                                                      
         25        FAST_CONCAT                                      ~19     '+and+smallest+', !4
         26        ECHO                                                     ~19
   63    27      > 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/JNBTC
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/JNBTC
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:
137.35 ms | 1407 KiB | 15 Q