Строки в PHP Строки в PHP by Sara
(Post a new comment)
(Reply to this)
(Reply to this) (Thread)
(Reply to this) (Parent)(Thread)
INIT STRING ~0 ADD_STRING ~0 ~0 'This' ADD_STRING ~0 ~0 ' ' ADD_STRING ~0 ~0 'is'
(Reply to this) (Parent)
realloc(Void_t* p, size_t n) Returns a pointer to a chunk of size n that contains the same data as does chunk p up to the minimum of (n, p's size) bytes, or null if no space is available. The returned pointer may or may not be the same as p. The algorithm prefers extending p when possible, otherwise it employs the equivalent of a malloc-copy-free sequence. If p is null, realloc is equivalent to malloc.
$a = ''; $b = 'abcd'; for ($i = 1000000; $i > 0; $i--) { $a .= $b; real 0m10.732s user 0m7.351s sys 0m2.407s $a = ''; $b = 'abcd'; ob_start(); for ($i = 1000000; $i > 0; $i--) { echo $b; } $b = ob_get_clean(); real 0m4.243s user 0m3.117s sys 0m0.982s