ramiismail / dopresskit

presskit() - spend time making games, not press.
GNU General Public License v3.0
133 stars 50 forks source link

Titles do not work on HHVM #43

Open Rotonen opened 9 years ago

Rotonen commented 9 years ago

HHVM seems a bit stricter about what you can pass around as constants and how.

Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 74
Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 77
Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 80
Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 86
Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 83
Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 110
Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 113
Warning: Constants may only evaluate to scalar values in /var/www/<redacted>/index.php on line 89

https://github.com/ramiismail/dopresskit/blob/a6e0d1fd6f65be6618d8bbc11851320c690b6d9a/archive/index.php#L74

This leads into trouble displaying some of the titles from the xml file.

Notice: Use of undefined constant COMPANY_TITLE - assumed 'COMPANY_TITLE' in /var/www/<redacted>/index.php on line 213
Notice: Use of undefined constant COMPANY_TITLE - assumed 'COMPANY_TITLE' in /var/www/<redacted>/index.php on line 222
Notice: Use of undefined constant COMPANY_WEBSITE - assumed 'COMPANY_WEBSITE' in /var/www/<redacted>/index.php on line 223
Notice: Use of undefined constant COMPANY_WEBSITE - assumed 'COMPANY_WEBSITE' in /var/www/<redacted>/index.php on line 223
Notice: Use of undefined constant COMPANY_TITLE - assumed 'COMPANY_TITLE' in /var/www/<redacted>/index.php on line 265
Notice: Use of undefined constant COMPANY_BASED - assumed 'COMPANY_BASED' in /var/www/<redacted>/index.php on line 266
Notice: Use of undefined constant COMPANY_DATE - assumed 'COMPANY_DATE' in /var/www/<redacted>/index.php on line 270
Notice: Use of undefined constant COMPANY_WEBSITE - assumed 'COMPANY_WEBSITE' in /var/www/<redacted>/index.php on line 274
Notice: Use of undefined constant COMPANY_WEBSITE - assumed 'COMPANY_WEBSITE' in /var/www/<redacted>/index.php on line 274
Notice: Use of undefined constant COMPANY_CONTACT - assumed 'COMPANY_CONTACT' in /var/www/<redacted>/index.php on line 278
Notice: Use of undefined constant COMPANY_CONTACT - assumed 'COMPANY_CONTACT' in /var/www/<redacted>/index.php on line 278
Notice: Use of undefined constant COMPANY_PHONE - assumed 'COMPANY_PHONE' in /var/www/<redacted>/index.php on line 323
Notice: Use of undefined constant COMPANY_DESCRIPTION - assumed 'COMPANY_DESCRIPTION' in /var/www/<redacted>/index.php on line 328
Notice: Use of undefined constant COMPANY_TITLE - assumed 'COMPANY_TITLE' in /var/www/<redacted>/index.php on line 467
Notice: Use of undefined constant COMPANY_TITLE - assumed 'COMPANY_TITLE' in /var/www/<redacted>/index.php on line 499

Which leads into COMPANY_TITLE and the others to bleed onto the final result page instead of the parsed results.

The suggestion from the HHVM devs is to cast $child into string every time it gets used. They suspect that is what Zend is doing under the table silently and why it works in mainline PHP.

define("GAME_TITLE", (string)$child);