-1

In PHP, why is the function to convert a JSON string to a PHP object json_encode and in the Go world Marshal?

I've been reading the definitions and differences between marshaling and encoding, and I don't get why Golang would call it different to PHP?

Community
  • 1
  • 1
K2xL
  • 9,730
  • 18
  • 64
  • 101
  • Preference? Many languages have different names for functions that essentially perform the same operation. – Jay Blanchard Feb 02 '17 at 18:05
  • They are just different names for essentially the same thing. Note also that the json package does have Encoder and Decoder for use with streams. – JimB Feb 02 '17 at 18:08

1 Answers1

-1

Different languages call it different things, but they all do the same thing.

Go: Marshal
JavaScript: Stringify
Python: Dumps
Php: Encode
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106