php - Echo with parameters and without? -
i know following 3 statement prodcue same output:
echo "hello" . "world! <br/>"; echo "hello"; echo "world!", "<br/>"; echo "hello", "world!", "<br/>";   but preformance difference , why?
is slower concatenate "string" . "string" compared "string","string"?
it depends on mean performance... in terms of number of operations, first example best (has least number of operations)... second , third examples same.
opcodes echo "hello" . "world! <br/>"; here
finding entry points branch analysis position: 0 return found filename:       /in/oyvsm function name:  (null) number of ops:  3 compiled vars:  none line     # *  op                           fetch          ext  return  operands ---------------------------------------------------------------------------------    3     0  >   concat                                           ~0      'hello', 'world%21+%3cbr%2f%3e'          1      echo                                                     ~0    5     2    > return                                                   1  branch: #  0; line:     3-    5; sop:     0; eop:     2 path #1: 0,    opcodes echo "hello"; echo "world!", "<br/>";here
finding entry points branch analysis position: 0 return found filename:       /in/nmufh function name:  (null) number of ops:  4 compiled vars:  none line     # *  op                           fetch          ext  return  operands ---------------------------------------------------------------------------------    3     0  >   echo                                                     'hello'          1      echo                                                     'world%21'          2      echo                                                     '%3cbr%2f%3e'    5     3    > return                                                   1  branch: #  0; line:     3-    5; sop:     0; eop:     3 path #1: 0,    opcodes echo "hello", "world!", "<br/>"; here
finding entry points branch analysis position: 0 return found filename:       /in/lnpay function name:  (null) number of ops:  4 compiled vars:  none line     # *  op                           fetch          ext  return  operands ---------------------------------------------------------------------------------    3     0  >   echo                                                     'hello'          1      echo                                                     'world%21'          2      echo                                                     '%3cbr%2f%3e'    4     3    > return                                                   1  branch: #  0; line:     3-    4; sop:     0; eop:     3 path #1: 0,    so, can see using 1 echo operation on second , third examples. performance (read speed) negligible in these examples though.
Comments
Post a Comment