{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/22024","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/22024/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/22024/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/22024/events","html_url":"https://github.com/laravel/framework/issues/22024","id":272511313,"number":22024,"title":"Eloquent: issue when asking for a field as empty string","user":{"login":"Scutto","id":33514137,"avatar_url":"https://avatars2.githubusercontent.com/u/33514137?v=4","gravatar_id":"","url":"https://api.github.com/users/Scutto","html_url":"https://github.com/Scutto","followers_url":"https://api.github.com/users/Scutto/followers","following_url":"https://api.github.com/users/Scutto/following{/other_user}","gists_url":"https://api.github.com/users/Scutto/gists{/gist_id}","starred_url":"https://api.github.com/users/Scutto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scutto/subscriptions","organizations_url":"https://api.github.com/users/Scutto/orgs","repos_url":"https://api.github.com/users/Scutto/repos","events_url":"https://api.github.com/users/Scutto/events{/privacy}","received_events_url":"https://api.github.com/users/Scutto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-09T10:23:20Z","updated_at":"2017-11-09T12:04:01Z","closed_at":null,"author_association":"NONE","body":"I don t use Laravel but just the Eloquent package (\"illuminate/database\": \"5.2.37\")\r\n- PHP Version: 5.6.30\r\n- Database Driver & Version: mysql 5.6.35\r\n\r\nDescription:\r\nIn my script I was try to get different fields from a model, using an array containing the name of the fields that I want to get and lopping over it.\r\nFor my mistake one of the field was an empty string ('') and eloquent instead of throwing an error, start to do some weird stuff, it looks like its going into an infinite loop (since the script never stops to run also waiting 5 minutes (without the empty field takes 2/3 seconds) ) but the biggest issue is that somehow the memory in my pc was getting all filled up from the script.\r\nExample I checked the available storage in my pc before run the script (40GB), after 2/3 minutes of the script running the available was around 20GB.\r\n\r\nSteps To Reproduce:\r\n$array = ['name', 'birth_date', 'gender', ''];\r\n$model = Model::where('id', 1)->first();\r\n$store = [];\r\n\r\nforeach($array as $field_to_get){\r\n     $store[] = $model->$field_to_get;\r\n}\r\n\r\nWorks just fine for the first 3 fields, when it reach the last one starts the issue."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/343134919","html_url":"https://github.com/laravel/framework/issues/22024#issuecomment-343134919","issue_url":"https://api.github.com/repos/laravel/framework/issues/22024","id":343134919,"user":{"login":"Scutto","id":33514137,"avatar_url":"https://avatars2.githubusercontent.com/u/33514137?v=4","gravatar_id":"","url":"https://api.github.com/users/Scutto","html_url":"https://github.com/Scutto","followers_url":"https://api.github.com/users/Scutto/followers","following_url":"https://api.github.com/users/Scutto/following{/other_user}","gists_url":"https://api.github.com/users/Scutto/gists{/gist_id}","starred_url":"https://api.github.com/users/Scutto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scutto/subscriptions","organizations_url":"https://api.github.com/users/Scutto/orgs","repos_url":"https://api.github.com/users/Scutto/repos","events_url":"https://api.github.com/users/Scutto/events{/privacy}","received_events_url":"https://api.github.com/users/Scutto/received_events","type":"User","site_admin":false},"created_at":"2017-11-09T12:04:01Z","updated_at":"2017-11-09T12:04:01Z","author_association":"NONE","body":"Okay, well maybe someone with the latest version can check if this error is still there or not !"}}
{"actor":{"display_login":"Scutto"}}