3v4l.org

run code in 300+ PHP versions simultaneously
<?php $A = array(9,4,10); function standard_deviation($A){ if(is_array($sample)){ $mean = array_sum($sample) / count($sample); foreach($sample as $key => $num) $devs[$key] = pow($num - $mean, 2); return sqrt(array_sum($devs) / (count($devs) - 1)); } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7TTXd
function name:  (null)
number of ops:  2
compiled vars:  !0 = $A
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1      > RETURN                                                   1

Function standard_deviation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 31
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7TTXd
function name:  standard_deviation
number of ops:  32
compiled vars:  !0 = $A, !1 = $sample, !2 = $mean, !3 = $num, !4 = $key, !5 = $devs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        TYPE_CHECK                                  128          !1
          2      > JMPZ                                                     ~6, ->31
    6     3    >   INIT_FCALL                                               'array_sum'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        COUNT                                            ~8      !1
          7        DIV                                              ~9      $7, ~8
          8        ASSIGN                                                   !2, ~9
    7     9      > FE_RESET_R                                       $11     !1, ->20
         10    > > FE_FETCH_R                                       ~12     $11, !3, ->20
         11    >   ASSIGN                                                   !4, ~12
         12        INIT_FCALL                                               'pow'
         13        SUB                                              ~15     !3, !2
         14        SEND_VAL                                                 ~15
         15        SEND_VAL                                                 2
         16        DO_ICALL                                         $16     
         17        ASSIGN_DIM                                               !5, !4
         18        OP_DATA                                                  $16
         19      > JMP                                                      ->10
         20    >   FE_FREE                                                  $11
    8    21        INIT_FCALL                                               'sqrt'
         22        INIT_FCALL                                               'array_sum'
         23        SEND_VAR                                                 !5
         24        DO_ICALL                                         $17     
         25        COUNT                                            ~18     !5
         26        SUB                                              ~19     ~18, 1
         27        DIV                                              ~20     $17, ~19
         28        SEND_VAL                                                 ~20
         29        DO_ICALL                                         $21     
         30      > RETURN                                                   $21
   10    31    > > RETURN                                                   null

End of function standard_deviation

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.33 ms | 1400 KiB | 19 Q