所以,我正在研究一个项目,因为我不断收到错误和警告,所以我遇到了问题。我是PHP的新手,所以要温柔。该程序使用PHP 5.5运行正常但是当我在PHP 5.6中运行该程序时,我收到如下几个错误;
[10-Oct-2016 10:04:46 America / Denver] PHP警告:在/hermes/bosnaweb14a/b1234/.../application中反序列化'MMR \ Bundle \ CodeTyperBundle \ Entity \ User'的错误数据格式第833行的/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php [2016年10月10日10:04:46 America / Denver] PHP注意:unserialize():/hermes/bosnaweb14a/b1234/.../application/vendor/doctrine/orm/lib中50字节偏移量49的错误第833行的/Doctrine/ORM/Mapping/ClassMetadataInfo.php [10-Oct-2016 10:04:46 America / Denver] PHP致命错误:在/hermes/bosnaweb14a/b1234/.../application/vendor/doctrine/orm/lib/Doctrine/中调用非对象的__clone方法第837行的ORM / Mapping / ClassMetadataInfo.php
项目信息
平台:Symfony PHP版本:5.6
受影响的代码
#Approach 1: divide data age-wise
train <- vif_data$Age < 30
# there are around 400 values passing (TRUE) above condition and around 50 failing (FALSE)
train_vif <- vif_data[train,]
test_vif <- vif_data[!train,]
#taking QDA
zone_qda <- qda(train_vif$Awareness~train_vif$Zone, na.action = na.exclude)
#compare QDA against test data
zone_pred <- predict(zone_qda, test_vif)
#omitting nulls
pred <- na.omit(zone_pred$class)
true <- na.omit(test_vif$Awareness)
length(pred) # result: 399
length(true) # result: 47
#that's where it throws error: "Error in table(zone_pred$class, train_vif) : all arguments must have the same length"
zone_aware <- table(zone_pred$class, train_vif)
# OR
zone_aware <- table(pred, true)
accur <- mean(zone_pred$class==test_vif$Awareness)
###############################
#Approach 2: divide data into random halves
train <- splitSample(dataset = vif_data, div = 2, path = "./", type = "csv")
train_data <- read.csv("splitSample_s1.csv")
test_data <- read.csv("splitSample_s2.csv")
#taking QDA
zone_qda <- qda(train_vif$Awareness~train_vif$Zone, na.action = na.exclude)
#compare QDA against test data
zone_pred <- predict(zone_qda, test_vif)
#omitting nulls
pred <- na.omit(zone_pred$class)
true <- na.omit(test_vif$Awareness)
length(train_vif)
# this works fine
zone_aware <- table(zone_pred$class, train_vif)
# OR
zone_aware <- table(pred, true)
accur <- mean(zone_pred$class==test_vif$Awareness)
非常感谢任何帮助
答案 0 :(得分:0)
我测试过:
var_dump(clone $t=unserialize(sprintf('O:%d:"%s":0:{}', strlen('name'), 'name')));
它有效。
您必须检查$this->name
的值可能是空的或有非法字符。
首先设置$this->name
的位置?