PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/date/tests/date_time_immutable.phpt ('Tests for DateTimeImmutable.')

Script

1: <?php
2: $tz 
= new DateTimeZone("Asia/Tokyo");
3:
$current "2012-12-27 16:24:08";
4:
5: function 
dump($a$b$c)
6: {
7:     echo 
'orig:    '$a->format('Y-m-d H:i:s e'), "\n";
8:     echo 
'copy:    '$b->format('Y-m-d H:i:s e'), "\n";
9:     echo 
'changed: '$c->format('Y-m-d H:i:s e'), "\n";
10: }
11:
12: echo 
"modify():\n";
13:
$v date_create_immutable($current);
14:
$z $v;
15:
$x $z->modify("+2 days");
16:
dump($v$z$x);
17:
$v date_create($current);
18:
$z $v;
19:
$x $z->modify("+2 days");
20:
dump($v$z$x);
21:
22: echo 
"\nadd():\n";
23:
$v date_create_immutable($current);
24:
$z $v;
25:
$x $z->add(new DateInterval("P2DT2S"));
26:
dump($v$z$x);
27:
$v date_create($current);
28:
$z $v;
29:
$x $z->add(new DateInterval("P2DT2S"));
30:
dump($v$z$x);
31:
32: echo 
"\nsub():\n";
33:
$v date_create_immutable($current);
34:
$z $v;
35:
$x $z->sub(new DateInterval("P2DT2S"));
36:
dump($v$z$x);
37:
$v date_create($current);
38:
$z $v;
39:
$x $z->sub(new DateInterval("P2DT2S"));
40:
dump($v$z$x);
41:
42: echo 
"\nsetTimezone():\n";
43:
$v date_create_immutable($current);
44:
$z $v;
45:
$x $z->setTimezone($tz);
46:
dump($v$z$x);
47:
$v date_create($current);
48:
$z $v;
49:
$x $z->setTimezone($tz);
50:
dump($v$z$x);
51:
$v = new DateTimeImmutable($current);
52:
$z $v;
53:
$x $z->setTimezone($tz);
54:
dump($v$z$x);
55:
56: echo 
"\nsetTime():\n";
57:
$v date_create_immutable($current);
58:
$z $v;
59:
$x $z->setTime(5719);
60:
dump($v$z$x);
61:
$v date_create($current);
62:
$z $v;
63:
$x $z->setTime(5719);
64:
dump($v$z$x);
65:
66: echo 
"\nsetDate():\n";
67:
$v date_create_immutable($current);
68:
$z $v;
69:
$x $z->setDate(5719);
70:
dump($v$z$x);
71:
$v date_create($current);
72:
$z $v;
73:
$x $z->setDate(5719);
74:
dump($v$z$x);
75:
76: echo 
"\nsetIsoDate():\n";
77:
$v date_create_immutable($current);
78:
$z $v;
79:
$x $z->setIsoDate(201226);
80:
dump($v$z$x);
81:
$v date_create($current);
82:
$z $v;
83:
$x $z->setIsoDate(201226);
84:
dump($v$z$x);
85:
86: echo 
"\nsetTimestamp():\n";
87:
$v date_create_immutable($current);
88:
$z $v;
89:
$x $z->setTimestamp(2012234222);
90:
dump($v$z$x);
91:
$v date_create($current);
92:
$z $v;
93:
$x $z->setTimestamp(2012234222);
94:
dump($v$z$x);
95:
?>
96:

Report

==6896== Conditional jump or move depends on uninitialised value(s)
==6896==    at 0x4DEC1D: do_adjust_timezone (tm2unixtime.c:467)
==6896==    by 0x4DEF86: timelib_update_ts (tm2unixtime.c:511)
==6896==    by 0x46C2F9: php_date_date_set (php_date.c:3583)
==6896==    by 0x46C578: zim_DateTimeImmutable_setDate (php_date.c:3618)
==6896==    by 0x1171C4B: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1336)
==6896==    by 0x1171C4B: execute_ex (zend_vm_execute.h:60397)
==6896==    by 0x1197C83: zend_execute (zend_vm_execute.h:66602)
==6896==    by 0xF27316: zend_execute_scripts (zend.c:1629)
==6896==    by 0xE15279: php_execute_script (main.c:2650)
==6896==    by 0x119DB6F: do_cli (php_cli.c:985)
==6896==    by 0x119F611: main (php_cli.c:1375)
==6896== 
==6896== Conditional jump or move depends on uninitialised value(s)
==6896==    at 0x4DEC1D: do_adjust_timezone (tm2unixtime.c:467)
==6896==    by 0x4DEF86: timelib_update_ts (tm2unixtime.c:511)
==6896==    by 0x46C2F9: php_date_date_set (php_date.c:3583)
==6896==    by 0x46C407: zif_date_date_set (php_date.c:3598)
==6896==    by 0x1171C4B: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1336)
==6896==    by 0x1171C4B: execute_ex (zend_vm_execute.h:60397)
==6896==    by 0x1197C83: zend_execute (zend_vm_execute.h:66602)
==6896==    by 0xF27316: zend_execute_scripts (zend.c:1629)
==6896==    by 0xE15279: php_execute_script (main.c:2650)
==6896==    by 0x119DB6F: do_cli (php_cli.c:985)
==6896==    by 0x119F611: main (php_cli.c:1375)
==6896== 

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (295 days ago)

Copyright © 2005-2020 The PHP Group
All rights reserved.