Jump to content

Recommended Posts

Posted

Hi.

I can't understand why explode method doesn't work

I expect to get 

[
	'test' => [
			'a' => 'b'
		],
	'test2' => [
			'a' => 'b'
		]

]

But I get 

chrome_plS4vyyutC.png

 

Posted

Based on the explode documentation I agree with your expected result. The reason your code doesn't work is that the callback is never called if the WireArray items are not objects. Not sure if that is intentional, but the documentation is definitely misleading on this one. I also see no reason why the callback variant shouldn't work for non-object items. You should open an issue on Github for this bug!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...