3
votes

Warning: A non-numeric value encountered in C:\Program Files (x86)\Ampps\www\Symfony_project\lib\vendor\symfony1\lib\yaml\sfYamlInline.php(138) : runtime-created function on line 1

Use php 7.1

if (
      (1 == count($keys) && '0' == $keys[0])
      ||
    Line 138->  (count($keys) > 1 && array_reduce($keys, create_function('$v,$w', 'return (integer) $v + $w;'), 0) == count($keys) * (count($keys) - 1) / 2))

23 0.1704 3586632 __lambda_func( ) ...\sfYamlInline.php:138

How to fix?

1
Symfony 1 hasn't been maintained in 5 years, and isn't fully compatible with PHP versions since then, so you're liable to get errors like this. You haven't got many options other than patching the source yourself. - iainn
@chris85 That's the correct syntax for create_function (which admittedly no one should have been using since PHP 5.3 came out) - iainn
You might want to look at LExpress/symfony1, which is an up-to-date fork of SF1 - iainn
symfony1 with PHP 7.1. Why? - Stephan Vierkant
@iainn Ah, it does an eval. - chris85

1 Answers

4
votes

There are some forks of symfony1 out there that are compatible with PHP7.1.

In this case, you can patch this easily by changing 'return (integer) $v + $w;' to 'return (integer) $v + (integer) $w;'.