dongqi1245 2016-09-10 04:38
浏览 70
已采纳

解析错误:升级到laravel 5.2后无效的数字文字

I am just upgrading laravel 5.1 to 5.2. Everything run smoothly except my seeder.

When I run seeder, i found this error:

admin@arrasyid:/var/www/sys_pb$ php artisan db:seed


  [Symfony\Component\Debug\Exception\FatalThrowableError]  
  Parse error: Invalid numeric literal                     

I could not find the solution after googling on the error. Please give me an advice related to this. thanks

  • 写回答

2条回答 默认 最新

  • dth981485742 2016-09-10 04:54
    关注

    From the PHP 7 Migration Guide in the Manual

    Invalid Octal Literals

    Previously, octal literals that contained invalid numbers were silently truncated (0128 was taken as 012). Now, an invalid octal literal will cause a parse error.

    Changes to integer handling

    So this means that something like this in your code as of PHP 7 can cause a fatal parse error with Invalid numeric literal whereas previously in PHP 5 it would have been silently ignored.

    $arr = [08, 09, 10, 11]; // works in PHP 5, throws fatal error in PHP 7
    

    See this 3v4l as an example.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员